import { Router, ActivatedRoute, ParamMap } from '@angular/router';
import { Component, OnInit } from '@angular/core';
import { HttpClient } from '@angular/common/http';

@Component({
  selector: 'app-equipment-detail',
  templateUrl: './equipment-detail.component.html',
  styleUrls: ['./equipment-detail.component.sass']
})
export class EquipmentDetailComponent implements OnInit {

  constructor(
       private route: ActivatedRoute,
private http:HttpClient
  ) { }

  id:any;
  detail:any;
  ngOnInit(): void {

 this.route.queryParams.subscribe(params => {
    this.id = params['id'];
  });
        let res = this.http.get(`http://localhost:8000/equipments/asset:006`)
        res.subscribe(
        data=>this.detail = data,
        error=>console.log(error)
        )

     console.log(this.detail)

  }

}
